Repository navigation
Vendor the Spec conformance fixtures at a pinned commit (Stage 1, PR 1 of 3) - #183
Merged
Merged
Conversation
Adds tests/spec_fixtures/: the MorphoBricks-Spec fixtures/ folder, docs/experiment-v1.md and the reference validator (a test oracle only) at Spec commit 8922a359ec26, with PIN.toml. - tests/test_spec_pin.py: the vendored fixtures/ folder must hash (git tree algorithm) to `git rev-parse <sha>:fixtures`; the two single files to their blob IDs. One changed, added, removed, renamed or CRLF-converted file fails. - tests/spec_gate.py: a skipped or xfailed test in any tests/test_spec_*.py is a failure. - tests/test_spec_no_fallback.py: no second table of codes or names, no lenient, legacy or default-version path in the reader modules (description*.py); the scan is itself tested. - tests/test_spec_vendored_missing.py: with the vendored tree removed the suite fails. - tests/test_spec_catalogue.py: every fixture has its header lines and a catalogue row. Tests only: no change to the package, the CLI, the notebook or any output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
This was referenced Nov 7, 2026
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 1 of the Stage 1 design (section 5): the executable-conformance groundwork for the experiment-description reader. Tests and test data only. No change to the package, the CLI, the notebook, any output or any existing run. It waits for R7 / Gate G0 like the rest of Stage 1 and must not merge earlier.
The normative text and fixtures are in MorphoBricks-Spec at commit
8922a359ec261148a23a4b6e740a1bdb69e9e318(docs/experiment-v1.md,docs/conformance-plan.mdsections 1 and 2,fixtures/).Stack: this is the base of a stack of three. PR 2 (reader phases 1-3) and PR 3 (phases 4-5 and warnings) are opened on top of it, against
main; their diffs contain this one until it merges.What changed
tests/spec_fixtures/is a partial copy of the Spec at the pinned commit, laid out as in the Spec:fixtures/(179 files),docs/experiment-v1.md,tools/audit/refval.py(the reference validator, test oracle only, nothing insrc/imports it).PIN.tomlholds the full commit SHA,git rev-parse <sha>:fixtures(6d114d80...) and the two blob IDs..gitattributessets-textso no checkout converts line endings.tests/test_spec_pin.py(pin integrity): the vendoredfixtures/hashes to the pin with git's tree algorithm (own implementation, checked against known git answers including the folder-sorts-as-name/rule; git itself gives6d114d80...for the committed folder). One changed, added, removed, renamed or CRLF-converted file fails, as do the two other files and a pin that is not a 40-digit SHA.tests/spec_gate.py(+conftest.py): a skipped,skipif,importorskipor xfailed test in anytests/test_spec_*.pyis reported as a failure. Tested in a child pytest.tests/test_spec_no_fallback.py("no fallback rules"): AST scan for a second table of codes, a copy of the forbidden or reserved names (compared with the vendored text), code literals outside the one rules module, and lenient/legacy/fallback/default-version markers. The scan is tested against known-bad snippets. Until PR 2 addsdescription*.pythe reader-module part has nothing to scan; PR 2 makes that non-vacuous.tests/test_spec_vendored_missing.py: with the vendored tree empty, absent or withoutfixtures/, the suite fails (collection error), never passes on defaults and never skips.tests/test_spec_catalogue.py: every fixture (discovered from the directory) hasFixture/Expected/Sourceheaders matching its name and its catalogue row; the catalogue lists every file and nothing else; 36 valid, 130 invalid, 12 transitions.pyproject.toml/tools/check.py: the vendored copies are excluded from ruff and the code rules (byte-exact files, not our code).docs/development.mdandCHANGELOG.mddescribe the pin and the gate.Regression test: new tests, so there is no old-code run. Negative check done by hand: changing one byte of
v01_single_control.tomlmakestests/test_spec_pin.pyfail (11 failed, 5 passed); restored, 16 passed.Notes for review
tests/spec_fixtures/README.mdlists the steps).-textattribute is what protects the hashes there).Tests
python tools/check.py: ruff check clean, ruff format clean, code rules clean, 2713 passed, 4 skipped (2316 passed, 4 skipped onmain3231966; the 397 new tests pass; the 4 skips are the same pre-existing ones intest_cli_log,test_discovery,test_folder_rules, none in a Spec test).Generated by Claude Code